package net.xo68.destiny.worker.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

import java.util.Collections;

/**
 * 服务端bean配置
 * @author wuxie
 * @version 2020-8-5
 */
@Configuration
public class ServerConfig {


    @Bean
    public RestTemplate restTemplate(ApiRequestInterceptor apiRequestInterceptor){
        RestTemplate restTemplate = new RestTemplate();
        restTemplate.setInterceptors(Collections.singletonList(apiRequestInterceptor));
        return restTemplate;
    }


}
